
function ww(arr, areget) {
  let i = 0
  try {
    arr.reduce((v1, v2) => {
       if ((v1 + v2) === areget) throw [i-1, i]
       i++
       return v1 + v2
    },0)
  } catch (res) {
    return res
  }
}
const r = ww([1,7,0,1,2,3,4,5], 9)
console.log('111', r)
const str = 'helloscddvgdf'
function qwqw(arr, areget) {
  let i = 0
  try {
    arr.reduce((v1, v2) => {
      if (v1 !== v2 && areget) throw [i-1, i]
      i++
      return v2
    },0)
  } catch (res) {
    return res
  }
}

